package com.example.mqconsumer.consumer;


import com.example.common.message.Demo03Message;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Log4j2
@Component
@RabbitListener(queues = Demo03Message.QUEUE_B)
public class Demo03ConsumerB {

    @RabbitHandler
    public void onMessage(Demo03Message msg) {
        log.info(Demo03Message.QUEUE_B + "接收到数据:" + msg.getId());
    }
}
